package ch01.reflect;

public class Demo06 {
    public static void main(String[] args) {
        try {
            Class clz=Class.forName("ch01.reflect.entity.Person");//加载Person类
            Object obj=clz.newInstance();//调用Person类中的无参构造方法创建Person类实例
            System.out.println(obj);//调用Person实例的toString()方法，属性均为默认值
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
